//
//  RecommendDetailTableViewCell.m
//  JZMCFM
//
//  Created by zhangxin.com on 15/11/3.
//  Copyright (c) 2015年 陈卓. All rights reserved.
//

#import "RecommendDetailTableViewCell.h"

@implementation RecommendDetailTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self setDetaiCellChild];
    }
    return self;
}

- (void)setDetaiCellChild
{
    self.coverImageView = [[UIImageView alloc]initWithFrame:CGRectMake(5, 5,kscreenwidth/5, kscreenwidth/5)];
   
    [self addSubview:self.coverImageView];
    
    self.titlelable = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.coverImageView.frame)+5,self.coverImageView.frame.origin.y, kscreenwidth/5*4-10, kscreenwidth/5/4*2)];
   
    [self addSubview:self.titlelable];
    self.introlable = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.coverImageView.frame)+5, CGRectGetMaxY(self.titlelable.frame), kscreenwidth/5*4-10, kscreenwidth/5/4*1)];
  
    [self addSubview:self.introlable];
    
    self.playCountlable = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.coverImageView.frame)+5, CGRectGetMaxY(self.introlable.frame), kscreenwidth/6, kscreenwidth/5/4*1)];
  
    [self addSubview:self.playCountlable];
    self.trackslable = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(self.playCountlable.frame), self.playCountlable.frame.origin.y, kscreenwidth/8, kscreenwidth/5/4*1)];
  
    [self addSubview:self.trackslable];
    
    
    
}
- (void)setdetailcellmodel:(RecommedTitleModel *)model
{
    [self.coverImageView sd_setImageWithURL:[NSURL URLWithString:model.coverMiddle]];
    NSLog(@"%@",model.coverMiddle);
    self.titlelable.text = model.title;
   self.titlelable.font = [UIFont systemFontOfSize:14];
    self.introlable.text = model.intro;
    self.introlable.font = [UIFont systemFontOfSize:12];
    self.playCountlable.text = [NSString stringWithFormat:@"%ld万",model.playsCounts/10000];
    self.playCountlable.font = [UIFont systemFontOfSize:10];
    self.trackslable.text = [NSString stringWithFormat:@"%ld集",model.tracks];
    self.trackslable.font = [UIFont systemFontOfSize:10];
}

- (void)setdetailcellforJINGBINGTINGDANmodel:(RecommedTitleModel *)model1
{
    [self.coverImageView sd_setImageWithURL:[NSURL URLWithString:model1.coverPathSmall]];
    
    self.titlelable.text = model1.title;
    self.titlelable.font = [UIFont systemFontOfSize:14];
    self.introlable.text = model1.subtitle;
    self.introlable.font = [UIFont systemFontOfSize:12];
    self.playCountlable.text = [NSString stringWithFormat:@"%@",model1.footnote];
    self.playCountlable.font = [UIFont systemFontOfSize:10];

    
    
    
    
}
@end
